CC=g++
OBJS=anonymous_ftp_login.o main.o functions.o global.o lib_for_lua.o lib_for_python.o
INCLUDE= -I/usr/include/lua5.1/ -I/usr/include/libxml2/ -I/usr/include/python2.6/
LIB= -L/usr/lib/ -llua5.1 -lxml2 -lpython2.6
EXEC=scan

$(EXEC): $(OBJS)
	$(CC) -o $@ $(INCLUDE) $(LIB) $^
	rm -rf *.o

global.o: global.cpp global.h
	$(CC) -c $<

lib_for_lua.o: lib/lib_for_lua.cpp lib/lib_for_lua.h
	$(CC) -c $(INCLUDE) $(LIB) $<

lib_for_python.o: lib/lib_for_python.cpp lib/lib_for_python.h
	$(CC) -c $(INCLUDE) $(LIB) $<

anonymous_ftp_login.o: anonymous_ftp_login.cpp anonymous_ftp_login.h global.h
	$(CC) -c $<

main.o: main.cpp anonymous_ftp_login.h
	$(CC) -c $(INCLUDE) $(LIB) $<

functions.o: functions.cpp functions.h
	$(CC) -c $<

clean:
	rm -rf $(EXEC) *.o
